let path = require("path");
const webpack = require("webpack");

module.exports = {
  //开发环境
  devServer: {
    open: true, //是否自动弹出浏览器页面
    proxy: {
      "^/api": {
        target: process.env.VUE_APP_API_PROXY_URL,
        changeOrigin: true, //是否跨域
        pathRewrite: {
          "^/api": "/",
        },
      },
      "^/saas": {
        target: process.env.VUE_APP_API_PROXY_SAAS_URL,
        changeOrigin: true, //是否跨域
      },
      //安卓下载域名
      "^/wwwAppVersion": {
        target: process.env.VUE_APP_API_PROXY_CCMS_URL,
        changeOrigin: true, //是否跨域
      },
    },
  },
  configureWebpack: config => {
    // 增加编译hash
    config.output.filename = '[name].[hash].js'
    config.output.chunkFilename = '[name].[hash].js'
  },
  //根目录静态文件
  publicPath: "/",
  outputDir: "dist",
  assetsDir: "static",
  productionSourceMap: false,
};
